<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Equity Query</title>
</head>
<!-- <script type="text/javascript">
	function checkData(){
		var x = document.forms["searchForm"]["equityName"].value;
		if(x==null || x==""){
			alert("Please enter atleast intial few characters to search.");
			return false;
			}
		}
</script> -->
<body>
	<form:form name="searchForm" method="post" modelAttribute="equity">
	<form:errors cssClass="error"></form:errors>
		<fmt:message key="equity_search_label"></fmt:message>
		<form:input id="equityName" path="equityName"/>
		<form:errors path="equityName" cssClass="error"></form:errors>
		<div class="buttons">
			<button type="submit" class="positive" name="search">Search</button> 
		</div>
	</form:form>
	<br class="clearfix">
	<br class="clearfix">
	<c:if test="${not empty resultList}">
		<table>
			<tr>
				<!-- <th>ID</th> -->
				<th>Name</th>
				<th>BSE</th>
				<th>NSE</th>
				<th>ISIN</th>
				<th>Sector</th>
			</tr>
			<c:forEach items="${resultList}" var="result">
				<tr>
					<%-- <td>${result.equityId}</td> --%>
					<td>${result.equityName}</td>
					<td>${result.equityBSE}</td>
					<td>${result.equityNSE}</td>
					<td>${result.equityISIN}</td>
					<td>${result.equitySector.sectorName}</td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
</body>
</html>